<?php

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateKdPaperExamTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kd_paper_exam', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('designer_id')->comment('设计师用户ID');
            $table->string('category')->default(1)->comment('1,小白；2,初级；3,中级；4,高级；5,资深；6,大咖；');
            $table->timestamp('start_time')->comment('开始时间');
            $table->timestamp('end_time')->nullable()->comment('结束时间');
            $table->tinyInteger('score')->default(0)->comment('分数');
            $table->tinyInteger('status')->default(1)->comment('1答题中，2答题结束');
            $table->tinyInteger('exam_res')->default(2)->comment('1已通过，2未通过');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE kd_paper_exam COMMENT='考试记录表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kd_paper_exam');
    }
}
